<template>
  <el-tabs v-model="tabActive">
    <el-tab-pane v-for="(item, index) in tabOptions" :key="index" :label="item.label" :name="item.name">
      <el-tree
               :check-on-click-node=true
               :highlight-current=true
               :data="item.name === 'org' ? orgList : roleList"
               :expand-on-click-node=false
               ref="tree"
               :props="{label: item.name === 'org' ? 'name' : 'label'}"></el-tree>
    </el-tab-pane>
  </el-tabs>
</template>

<script>
import {mapActions,mapState} from "vuex";

export default {
  name: "userTabTree",
  data(){
    return {
      tabOptions: [
        {
          label: "按机构查找",
          name: "org"
        },
        {
          label: "按角色查找",
          name: "role"
        }
      ]
    }
  },
  computed: mapState({
    roleList: state => state.flowDesignStore.roleList,
    orgList: state => state.flowDesignStore.orgList,
  }),
  methods: {
    ...mapActions("flowDesignStore", ["getUserList"]),
  },
  mounted(){

  }
}
</script>

<style scoped>

</style>